package engine.utils;

import java.awt.Point;


public class GeneralUtils {
	/*public static <T> matrixParsing(<S>[][] fstMatrix,
			<S>[][] sndMatrix, Function<T> fct){
		
		return null;
	}*/
	
	public static int fromRGB2Gray(int rgbValue){
		int gray = -111;
		int red,green,blue;
		red = (rgbValue >> 16) & 0xFF;
		green = (rgbValue >> 8) & 0xFF;
		blue = rgbValue & 0xFF;
		
		gray = (red*29 + green*59 + blue*11)/100;
		
		return gray;
	}
	
	public static int calculateDistance(Point p1, Point p2){
		
		return (int) p1.distance(p2);
	}
}
